﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for tblLMGTransferDataVMI

/// Table Name : [TransferDataVMI]
/// Created By : CX
/// Created Date : Wednesday, April 20, 2011
/// </summary>
/// 
namespace CE.Transfer
{

    public class TransferLMGVMIDB
    {
        public TransferLMGVMIDB()
        {	//TODO: Add constructor logic here

        }

        public Int64 Insert(TransferLMGVMI transfer)
		{
			MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocInsert]";
			
			SortedList _sPara = new SortedList();
			
			#region Parameter			
            _sPara.Add("@ExportId", transfer.ExportId);
            _sPara.Add("@REFERENCE_NO", transfer.REFERENCE_NO);
            _sPara.Add("@POLICY_LINE_OF_BUSINESS", transfer.POLICY_LINE_OF_BUSINESS);
            _sPara.Add("@LINK_REFERENCE_NO", transfer.LINK_REFERENCE_NO);
            _sPara.Add("@POLICY_EFFECTIVE_DATE", transfer.POLICY_EFFECTIVE_DATE);
            _sPara.Add("@POLICY_EXPIRATION_DATE", transfer.POLICY_EXPIRATION_DATE);
            _sPara.Add("@ENTRY_DATE", transfer.ENTRY_DATE);
            _sPara.Add("@SIGN_DATE", transfer.SIGN_DATE);
            _sPara.Add("@SALUTATION", transfer.SALUTATION);
            _sPara.Add("@INSURED_NAME", transfer.INSURED_NAME);
            _sPara.Add("@INSURED_TYPE", transfer.INSURED_TYPE);
            _sPara.Add("@INSURED_SEX", transfer.INSURED_SEX);
            _sPara.Add("@ADDRESS_LINE1", transfer.ADDRESS_LINE1);
            _sPara.Add("@ADDRESS_LINE2", transfer.ADDRESS_LINE2);
            _sPara.Add("@TUMBON", transfer.TUMBON);
            _sPara.Add("@DISTRICT", transfer.DISTRICT);
            _sPara.Add("@STATE_PROVINCE", transfer.STATE_PROVINCE);
            _sPara.Add("@POSTAL_CODE", transfer.POSTAL_CODE);
            _sPara.Add("@COUNTRY", transfer.COUNTRY);
            _sPara.Add("@EMAIL_SEND_POLICY", transfer.EMAIL_SEND_POLICY);
            _sPara.Add("@MOBILE_PHONE_NO_1", transfer.MOBILE_PHONE_NO_1);
            _sPara.Add("@MOBILE_PHONE_NO_2", transfer.MOBILE_PHONE_NO_2);
            _sPara.Add("@HOME_PHONE_NO", transfer.HOME_PHONE_NO);
            _sPara.Add("@HOME_PHONE_EXTENSION_NO", transfer.HOME_PHONE_EXTENSION_NO);
            _sPara.Add("@OFFICE_PHONE_NO", transfer.OFFICE_PHONE_NO);
            _sPara.Add("@OFFICE_PHONE_EXTENSION_NO", transfer.OFFICE_PHONE_EXTENSION_NO);
            _sPara.Add("@ID_CARD_NO", transfer.ID_CARD_NO);
            _sPara.Add("@BIRTH_DATE", transfer.BIRTH_DATE);
            _sPara.Add("@MARITAL_STATUS", transfer.MARITAL_STATUS);
            _sPara.Add("@HOBBY", transfer.HOBBY);
            _sPara.Add("@AGENT_CODE", transfer.AGENT_CODE);
            _sPara.Add("@BROKER_CODE", transfer.BROKER_CODE);
            _sPara.Add("@PRODUCT_CODE", transfer.PRODUCT_CODE);
            _sPara.Add("@CAMPAIGN_CODE", transfer.CAMPAIGN_CODE);
            _sPara.Add("@MOTOR_CODE", transfer.MOTOR_CODE);
            _sPara.Add("@MOTOR_SUB_CODE", transfer.MOTOR_SUB_CODE);
            _sPara.Add("@VEHICLE_MAKE", transfer.VEHICLE_MAKE);
            _sPara.Add("@VEHICLE_MODEL", transfer.VEHICLE_MODEL);
            _sPara.Add("@VEHICLE_MODEL_TYPE", transfer.VEHICLE_MODEL_TYPE);
            _sPara.Add("@VEHICLE_BODY_TYPE", transfer.VEHICLE_BODY_TYPE);
            _sPara.Add("@VEHICLE_PREFIX_LICENSE_NO", transfer.VEHICLE_PREFIX_LICENSE_NO);
            _sPara.Add("@VEHICLE_LICENSE_NO", transfer.VEHICLE_LICENSE_NO);
            _sPara.Add("@KEY_FIELD", transfer.KEY_FIELD);
            _sPara.Add("@VEHICLE_CHASSIS_NO", transfer.VEHICLE_CHASSIS_NO);
            _sPara.Add("@VEHICLE_ENGINE_NO", transfer.VEHICLE_ENGINE_NO);
            _sPara.Add("@VEHICLE_COLOR", transfer.VEHICLE_COLOR);
            _sPara.Add("@VEHICLE_CAPACITY_KEY", transfer.VEHICLE_CAPACITY_KEY);
            _sPara.Add("@VEHICLE_WEIGHT", transfer.VEHICLE_WEIGHT);
            _sPara.Add("@VEHICLE_ENGINE_CAPACITY", transfer.VEHICLE_ENGINE_CAPACITY);
            _sPara.Add("@GROUP_OF_VEHICLE", transfer.GROUP_OF_VEHICLE);
            _sPara.Add("@VEHICLE_REG_YEAR", transfer.VEHICLE_REG_YEAR);
            _sPara.Add("@VEHICLE_REGISTRATION_NO", transfer.VEHICLE_REGISTRATION_NO);
            _sPara.Add("@VEHICLE_NO_OF_SEAT", transfer.VEHICLE_NO_OF_SEAT);
            _sPara.Add("@VEHICLE_NO_OF_PASSG", transfer.VEHICLE_NO_OF_PASSG);
            _sPara.Add("@HISTORY_CODE", transfer.HISTORY_CODE);
            _sPara.Add("@HISTORY_LEVEL", transfer.HISTORY_LEVEL);
            _sPara.Add("@BASIC_PREMIUM", transfer.BASIC_PREMIUM);
            _sPara.Add("@POLICY_UNIT_SI_AMOUNT", transfer.POLICY_UNIT_SI_AMOUNT);
            _sPara.Add("@AV5_BASIC_PREMIUM", transfer.AV5_BASIC_PREMIUM);
            _sPara.Add("@AV5_SUM_INSURED", transfer.AV5_SUM_INSURED);
            _sPara.Add("@PKG_CODE", transfer.PKG_CODE);
            _sPara.Add("@OCCUPATION_CODE", transfer.OCCUPATION_CODE);
            _sPara.Add("@OCCUPATION", transfer.OCCUPATION);
            _sPara.Add("@VEHICLE_GARAGE_LOCATION", transfer.VEHICLE_GARAGE_LOCATION);
            _sPara.Add("@VEHICLE_ADDITIONAL_EQUIPMENT", transfer.VEHICLE_ADDITIONAL_EQUIPMENT);
            _sPara.Add("@DRIVER1_NAME", transfer.DRIVER1_NAME);
            _sPara.Add("@DRIVER1_BIRTH_DATE", transfer.DRIVER1_BIRTH_DATE);
            _sPara.Add("@DRIVER1_SEX", transfer.DRIVER1_SEX);
            _sPara.Add("@DRIVER1_ID_CARD_NO", transfer.DRIVER1_ID_CARD_NO);
            _sPara.Add("@DRIVER1_OCCUPATION_CODE", transfer.DRIVER1_OCCUPATION_CODE);
            _sPara.Add("@DRIVER1_LICENSE_NO", transfer.DRIVER1_LICENSE_NO);
            _sPara.Add("@DRIVER2_NAME", transfer.DRIVER2_NAME);
            _sPara.Add("@DRIVER2_BIRTH_DATE", transfer.DRIVER2_BIRTH_DATE);
            _sPara.Add("@DRIVER2_SEX", transfer.DRIVER2_SEX);
            _sPara.Add("@DRIVER2_ID_CARD_NO", transfer.DRIVER2_ID_CARD_NO);
            _sPara.Add("@DRIVER2_OCCUPATION_CODE", transfer.DRIVER2_OCCUPATION_CODE);
            _sPara.Add("@DRIVER2_LICENSE_NO", transfer.DRIVER2_LICENSE_NO);
            _sPara.Add("@REMARKS", transfer.REMARKS);
            _sPara.Add("@ACOVOD_AMOUNT", transfer.ACOVOD_AMOUNT);
            _sPara.Add("@ACOVED_PERCENT", transfer.ACOVED_PERCENT);
            _sPara.Add("@ACOVFD_PERCENT", transfer.ACOVFD_PERCENT);
            _sPara.Add("@ACOVOT_PERCENT", transfer.ACOVOT_PERCENT);
            _sPara.Add("@GPRM", transfer.GPRM);
            _sPara.Add("@TAX", transfer.TAX);
            _sPara.Add("@STAMP", transfer.STAMP);
            _sPara.Add("@INSURED_NAME_LINE_2", transfer.INSURED_NAME_LINE_2);
            _sPara.Add("@MOBILE_PHONE_NUMBER", transfer.MOBILE_PHONE_NUMBER);
            _sPara.Add("@BENEFICIARY_CODE", transfer.BENEFICIARY_CODE);
            _sPara.Add("@BENEFICIARY_NAME", transfer.BENEFICIARY_NAME);
            _sPara.Add("@DRIVER1_OCCUPATION", transfer.DRIVER1_OCCUPATION);
            _sPara.Add("@DRIVER2_OCCUPATION", transfer.DRIVER2_OCCUPATION);
            _sPara.Add("@VEHICLE_PREV_INSURANCE_CO", transfer.VEHICLE_PREV_INSURANCE_CO);
            _sPara.Add("@VEHICLE_PREV_INS_POL_NO", transfer.VEHICLE_PREV_INS_POL_NO);
            _sPara.Add("@TAX_CORR_SALUTATION", transfer.TAX_CORR_SALUTATION);
            _sPara.Add("@TAX_CORR_NAME", transfer.TAX_CORR_NAME);
            _sPara.Add("@TAX_CORR_TYPE", transfer.TAX_CORR_TYPE);
            _sPara.Add("@TAX_CORR_SEX", transfer.TAX_CORR_SEX);
            _sPara.Add("@TAX_CORR_ADDRESS_LINE1", transfer.TAX_CORR_ADDRESS_LINE1);
            _sPara.Add("@TAX_CORR_ADDRESS_LINE2", transfer.TAX_CORR_ADDRESS_LINE2);
            _sPara.Add("@TAX_CORR_TUMBON", transfer.TAX_CORR_TUMBON);
            _sPara.Add("@TAX_CORR_DISTRICT", transfer.TAX_CORR_DISTRICT);
            _sPara.Add("@TAX_CORR_STATE_PROVINCE", transfer.TAX_CORR_STATE_PROVINCE);
            _sPara.Add("@TAX_CORR_POSTAL_CODE", transfer.TAX_CORR_POSTAL_CODE);
            _sPara.Add("@TAX_CORR_COUNTRY", transfer.TAX_CORR_COUNTRY);
            _sPara.Add("@TAX_CORR_TELEPHONE_NO", transfer.TAX_CORR_TELEPHONE_NO);
            _sPara.Add("@TAX_CORR_MOBILE_PHONE", transfer.TAX_CORR_MOBILE_PHONE);
            _sPara.Add("@VEHICLE_SURVEYOR", transfer.VEHICLE_SURVEYOR);
            _sPara.Add("@POLICY_COMBINE_TYPE", transfer.POLICY_COMBINE_TYPE);
            _sPara.Add("@AC_MOTOR_CODE", transfer.AC_MOTOR_CODE);
            _sPara.Add("@AC_MOTOR_SUB_CODE", transfer.AC_MOTOR_SUB_CODE);
            _sPara.Add("@AC_GPRM", transfer.AC_GPRM);
            _sPara.Add("@AC_TAX", transfer.AC_TAX);
            _sPara.Add("@AC_STAMP", transfer.AC_STAMP);
            _sPara.Add("@COVER_NOTE_DATE", transfer.COVER_NOTE_DATE);
            _sPara.Add("@CBC_TR_NO", transfer.CBC_TR_NO);
            _sPara.Add("@CBC_TR_ENTRY_DATE", transfer.CBC_TR_ENTRY_DATE);
            _sPara.Add("@RECEIVE_TEMP_RECEIPT_DATE", transfer.RECEIVE_TEMP_RECEIPT_DATE);
            _sPara.Add("@RECEIVE_PREMIUM_DATE_ORIG", transfer.RECEIVE_PREMIUM_DATE_ORIG);
            _sPara.Add("@MAILING_ADDRESS_LINE1", transfer.MAILING_ADDRESS_LINE1);
            _sPara.Add("@MAILING_ADDRESS_LINE2", transfer.MAILING_ADDRESS_LINE2);
            _sPara.Add("@MAILING_TUMBON", transfer.MAILING_TUMBON);
            _sPara.Add("@MAILING_DISTRICT", transfer.MAILING_DISTRICT);
            _sPara.Add("@MAILING_STATE_PROVINCE", transfer.MAILING_STATE_PROVINCE);
            _sPara.Add("@MAILING_POSTAL_CODE", transfer.MAILING_POSTAL_CODE);
            _sPara.Add("@MAILING_COUNTRY", transfer.MAILING_COUNTRY);
            _sPara.Add("@MAILING_TELEPHONE_NO", transfer.MAILING_TELEPHONE_NO);
            _sPara.Add("@MAILING_MOBILE_PHONE", transfer.MAILING_MOBILE_PHONE);

            #endregion
			
            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
		}

        public bool Update()
        {
            return true;
        }

        public bool Delete(Int64 id)
		{
			MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocDelete]";
			
			SortedList _sPara = new SortedList();	
			

            #region Parameter
            //_sPara.Add("@ID", id);
            //_sPara.Add("@ID2", id2);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result > 0;			
		}


    }


}


